<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="text" v-model="val">
        <ul>
            <li v-for="item,index in getNewList()" :key="index">{{item}}</li>
        </ul>
    </div>
    <script>
        // 利用事件实现列表过滤
        const vm = new Vue({
            el:"#app",
            data:{
                val:"",
                list:["aaa","bbb","abc","bac","bbc","cbb","ccc"]
            },
            methods:{
                getNewList(){
                    return this.list.filter(item => item.includes(this.val))
                }
            }
        })

    </script>
</body>
</html>